using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Project.Application.AccountApp;
using Project.Application.AccountApp.Dto;

namespace Project.Api.Controllers {
    [ApiController]
    [Route ("api/[controller]")]
    public class AccountController : ControllerBase {
        private readonly IAccountAppService _accountAppService;

        public AccountController (IAccountAppService accountAppService) {
            _accountAppService = accountAppService;
        }

        [HttpGet ("{id}")]
        public async Task<AccountDto> GetAccountAsync (long id) {
            return await _accountAppService.GetAccountByIdAsync (id);
        }
    }
}